﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using System.Security.Cryptography;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.Xml;

namespace TS_XY_Train_Repaire
{
    #region//--数字地图类--//
    internal interface IWPF_WorkPlace_OBJ
    {
        double CenterX { get; set; }
        double CenterY { get; set; }
        double iWidth { get; set; }
        double iHeight { get; set; }
        int iTrainCount { get; set; }
        string sWorkPlaceName { get; set; }
    }
    //机车基本属性定义
    internal interface IWPF_RepairTrainSpirit_OBJ
    {
        double CenterX { get; set; }
        double CenterY { get; set; }
        double iWidth { get; set; }
        double iHeight { get; set; }
        int iBMWID { get; set; }
        int iWorkPlaceID { get; set; }
        int iTrainID { get; set; }
        int iTrainState { get; set; }
        int iWorkState { get; set; }
        string sRPName { get; set; }
        string sTrainName { get; set; }
        string sTime { get; set; }
    }
    //配件基本属性定义
    internal interface IWPF_RepairFittingsSpirit_OBJ
    {
        double CenterX { get; set; }
        double CenterY { get; set; }
        double iWidth { get; set; }
        double iHeight { get; set; }
        int iBMWID { get; set; }
        int iWorkPlaceID { get; set; }
        int iTrainID { get; set; }
        int iTrainState { get; set; }
        int iWorkState { get; set; }
        string sRPName { get; set; }
        string sTrainName { get; set; }
        string sTime { get; set; }
    }
    //设备基本属性定义
    internal interface IWPF_RepairEqupmentSpirit_OBJ
    {
        double CenterX { get; set; }
        double CenterY { get; set; }
        double iWidth { get; set; }
        double iHeight { get; set; }
        int iBMWID { get; set; }
        int iWorkPlaceID { get; set; }
        int iTrainID { get; set; }
        int iTrainState { get; set; }
        int iWorkState { get; set; }
        string sRPName { get; set; }
        string sTrainName { get; set; }
        string sTime { get; set; }
    }
    #endregion
    public class TS_Win_Class
    {
        public static string _xml_SysSetting_Filename = AppDomain.CurrentDomain.BaseDirectory+"Config.xml";
        public static string _xml_SysSetting_CompanyName = "武汉铁路局襄阳机务段";
        public static string _EXP_Direct = @"C:\襄阳机务段导出文件\";
        public static string _Version = "V1.00.00.00";
        public static string _BuildTime = " 2017-11-01";
        public static string _AppName = "襄阳机务段检修现场作业管理系统";
        #region//--获取软件的授权信息--//
        /// <summary>
        /// 获取软件授权信息
        /// </summary>
        /// <returns>字符串</returns>
        public string GetCopyRight()
        {
            return ("本软件授权给" + GetCompanyName() + "使用，本软件由" + GetDevCompanyName() + "开发！<br/>CopyRight &#169; 2013 By <a href='mailto:Softye@263.net'><font color=666666>" + GetsysName() + "</font></a> ！ All Rights Reserved ！");
        }
        public string GetCompanyName()
        {
            return (_xml_SysSetting_CompanyName);
        }
        public string GetDevCompanyName()
        {
            return ("武汉铁盛机电科技有限公司");
        }
        public string GetsysName()
        {
            return ("机车整备图像无线实时传输系统");
        }
        public static string GetSQlConnStr()
        {
            return GetSQLConnString.GetSQLConnString.getSQLConnString().getConnnString();
        }
        //public static string GetSQlConnStr()
        //{
        //    return "Data Source=10.103.238.47;Initial Catalog=TS_Tech_AllInOne;password=Windows2008;Pooling=false;persist security info=True;user id=sa;workstation id=SERVER;packet size=4096";
        //}
        public static string GetJT6SQlConnStr()
        {
            return @"Data Source=10.105.238.23;Initial Catalog=JCZB;password=Windows2008;Pooling=false;persist security info=True;user id=softye;workstation id=SERVER;packet size=4096";
        }
        #endregion
        #region//--填充List Comb控件--//
        public static void FillListTypeAct(System.Windows.Forms.ComboBox cb, string strSQL)
        {
            SqlConnection conn = new SqlConnection(GetSQlConnStr());
            conn.Open();
            SqlCommand comm = new SqlCommand(strSQL, conn);
            SqlDataAdapter ad = new SqlDataAdapter();
            ad.SelectCommand = comm;
            DataSet ds = new DataSet();
            ad.Fill(ds);
            if (ds.Tables[0].Rows.Count > 0)
            {
                cb.DisplayMember = "f_name";
                cb.ValueMember = "f_id";
                cb.DataSource = ds.Tables[0];
            }
            else
            {
                cb.DataSource = null;
                cb.Text = "";
            }
            ad.Dispose();
            ds.Dispose();
            comm.Dispose();
            conn.Dispose();
        }
        public static void cbobox(System.Windows.Forms.ComboBox cb, string strSQL)
        {
            SqlConnection conn = new SqlConnection(GetSQlConnStr());
            conn.Open();
            SqlCommand comm = new SqlCommand(strSQL, conn);
            SqlDataAdapter ad = new SqlDataAdapter();
            ad.SelectCommand = comm;
            DataSet ds = new DataSet();
            ad.Fill(ds);
            cb.DisplayMember = "f_name";
            cb.ValueMember = "f_id";
            cb.DataSource = ds.Tables[0];
            ad.Dispose();
            comm.Dispose();
            conn.Dispose();
        }
        public static void FillListTypeAct(System.Windows.Forms.ComboBox cb, string strSQL, string strConn)
        {
            SqlConnection conn = new SqlConnection(strConn);
            conn.Open();
            SqlCommand comm = new SqlCommand(strSQL, conn);
            SqlDataAdapter ad = new SqlDataAdapter();
            ad.SelectCommand = comm;
            DataSet ds = new DataSet();
            ad.Fill(ds);
            cb.DisplayMember = "f_name";
            cb.ValueMember = "f_id";
            cb.DataSource = ds.Tables[0];
            ad.Dispose();
            comm.Dispose();
            conn.Dispose();
            ds.Dispose();
        }
        public static void FillListTypeAct(System.Windows.Forms.ListBox cb, string strSQL)
        {
            SqlConnection conn = new SqlConnection(GetSQlConnStr());
            conn.Open();
            SqlCommand comm = new SqlCommand(strSQL, conn);
            SqlDataAdapter ad = new SqlDataAdapter();
            ad.SelectCommand = comm;
            DataSet ds = new DataSet();
            ad.Fill(ds);
            cb.DisplayMember = "f_name";
            cb.ValueMember = "f_id";
            cb.DataSource = ds.Tables[0];
            ad.Dispose();
            comm.Dispose();
            conn.Dispose();

        }
        public static void FillListTypeAct(System.Windows.Forms.ListBox cb, string strSQL, string strConn)
        {
            SqlConnection conn = new SqlConnection(strConn);
            conn.Open();
            SqlCommand comm = new SqlCommand(strSQL, conn);
            SqlDataAdapter ad = new SqlDataAdapter();
            ad.SelectCommand = comm;
            DataSet ds = new DataSet();
            ad.Fill(ds);
            cb.DisplayMember = "f_name";
            cb.ValueMember = "f_id";
            cb.DataSource = ds.Tables[0];
            ad.Dispose();
            comm.Dispose();
            conn.Dispose();
        }
        public static void FillListTypeAct(System.Windows.Forms.FlowLayoutPanel cb, string strSQL)
        {
            cb.Controls.Clear();
            SqlConnection conn = new SqlConnection(GetSQlConnStr());
            conn.Open();
            SqlCommand comm = new SqlCommand(strSQL, conn);
            SqlDataReader read = comm.ExecuteReader();
            while (read.Read())
            {
                CheckBox _cb = new CheckBox();
                _cb.Name = "cb_D_" + read["f_id"].ToString();
                _cb.Text = read["f_name"].ToString();
                _cb.Width = 120;
                _cb.Padding = new System.Windows.Forms.Padding(0);
                _cb.Tag = read["f_id"].ToString();
                _cb.Margin = new Padding(0);
                if (read["f_count"].ToString() != "0")
                {
                    _cb.Checked = true;
                }
                cb.Controls.Add(_cb);
            }
            read.Close();
            read.Dispose();
            comm.Dispose();
            conn.Close();
            conn.Dispose();
        }
        #endregion
        #region //--填充FlowLayoutPanel--//
        public static void Fill_FLP_RadioBox(System.Windows.Forms.FlowLayoutPanel flp, string strsql, System.EventHandler EventFunc)
        {
            int iNum = 0;
            RadioButton[] boxList = new RadioButton[100];
            SqlConnection conn = new SqlConnection(TS_Win_Class.GetSQlConnStr());
            conn.Open();
            SqlCommand comm = new SqlCommand(strsql, conn);
            SqlDataReader read = comm.ExecuteReader();
            while (read.Read())
            {
                boxList[iNum] = new RadioButton();
                boxList[iNum].Text = read["f_name"].ToString();
                boxList[iNum].Tag = read["f_id"].ToString();
                boxList[iNum].TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
                boxList[iNum].CheckedChanged += new System.EventHandler(EventFunc);
                flp.Controls.Add(boxList[iNum]);
                iNum++;
            }
            read.Close();
            read.Dispose();
            comm.Dispose();
            conn.Close();
            conn.Dispose();
        }
        public static void Fill_FLP_RadioBox(System.Windows.Forms.FlowLayoutPanel flp, string strsql)
        {
            int iNum = 0;
            RadioButton[] boxList = new RadioButton[100];
            SqlConnection conn = new SqlConnection(TS_Win_Class.GetSQlConnStr());
            conn.Open();
            SqlCommand comm = new SqlCommand(strsql, conn);
            SqlDataReader read = comm.ExecuteReader();
            while (read.Read())
            {
                boxList[iNum] = new RadioButton();
                boxList[iNum].Text = read["f_name"].ToString();
                boxList[iNum].Tag = read["f_id"].ToString();
                boxList[iNum].TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
                flp.Controls.Add(boxList[iNum]);
                iNum++;
            }
            read.Close();
            read.Dispose();
            comm.Dispose();
            conn.Close();
            conn.Dispose();
        }
        #endregion
        #region//--将结果值整理成字符串--//
        public static string MakeSQLResultToOneString(string strSql, string strField, string strSeparator)
        {
            string str="";
            SqlConnection conn = new SqlConnection(GetSQlConnStr());
            conn.Open();
            SqlCommand comm = new SqlCommand(strSql, conn);
            SqlDataReader read = comm.ExecuteReader();
            int i = 0;
            while(read.Read())
            {
                if (i == 0)
                {
                }
                else
                {
                    str += strSeparator;
                }
                str += read[strField].ToString().Trim();
                i++;
            }
            conn.Close();
            return str;
        }
        #endregion
        #region//--执行SQL语句--//
        public static void MySqlCom(string strSql)
        {
            SqlConnection MyClassConn = new SqlConnection(GetSQlConnStr());
            SqlCommand MyClassComm = new SqlCommand(strSql, MyClassConn);
            MyClassConn.Open();
            MyClassComm.ExecuteNonQuery();
            MyClassConn.Close();
            MyClassConn.Dispose();
        }
        public static void MySqlCom(string strSql,string strConn)
        {
            SqlConnection MyClassConn = new SqlConnection(strConn);
            SqlCommand MyClassComm = new SqlCommand(strSql, MyClassConn);
            MyClassConn.Open();
            MyClassComm.ExecuteNonQuery();
            MyClassConn.Close();
            MyClassConn.Dispose();
        }
        public static string MySqlComGetCount(string strSql)
        {
            string _str = "0";
            SqlConnection MyClassConn = new SqlConnection(GetSQlConnStr());
            SqlCommand MyClassComm = new SqlCommand(strSql, MyClassConn);
            MyClassConn.Open();
            _str = MyClassComm.ExecuteNonQuery().ToString();
            MyClassConn.Close();
            MyClassConn.Dispose();
            return _str;
        }
        /// <summary>
        /// 自定义SQL命令执行语句--返回行号
        /// </summary>
        /// <param name="strSql">SQL语句</param>
        /// <returns>返回执行后行号</returns>
        public static string MySqlComGetID(string strSql)
        {
            SqlConnection MyClassConn = new SqlConnection(GetSQlConnStr());
            strSql = strSql + ";select @@IDENTITY As 'Identity'";
            SqlCommand MyClassComm = new SqlCommand(strSql, MyClassConn);
            MyClassConn.Open();
            string Index = (MyClassComm.ExecuteScalar()).ToString().Trim();
            MyClassConn.Close();
            MyClassConn.Dispose();
            return Index;
        }
        public static string MySqlComGetID(string strSql, string strConn)
        {
            SqlConnection MyClassConn = new SqlConnection(strConn);
            strSql = strSql + ";select @@IDENTITY As 'Identity'";
            SqlCommand MyClassComm = new SqlCommand(strSql, MyClassConn);
            MyClassConn.Open();
            string Index = (MyClassComm.ExecuteScalar()).ToString().Trim();
            MyClassConn.Close();
            MyClassConn.Dispose();
            return Index;
        }
        public static string GetSQlFieldValue(string strSql, string Field,string strConn)
        {
            string str = "";
            SqlConnection conn = new SqlConnection(strConn);
            conn.Open();
            SqlCommand comm = new SqlCommand(strSql, conn);
            SqlDataReader read = comm.ExecuteReader();
            if (read.HasRows)
            {
                read.Read();
                str = read[Field].ToString().Trim();
            }
            else
            {
                str = null;
            }
            conn.Close();
            return str;
        }
        public static string GetSQlFieldValue(string strSql, string Field)
        {
            string str = "";
            SqlConnection conn = new SqlConnection(GetSQlConnStr());
            conn.Open();
            SqlCommand comm = new SqlCommand(strSql, conn);
            SqlDataReader read = comm.ExecuteReader();
            if (read.HasRows)
            {
                read.Read();
                str = read[Field].ToString().Trim();
            }
            else
            {
                str = null;
            }
            conn.Close();
            return str;
        }
        public static string[] GetSQlFieldValue(string strSql, string[] Field)
        {
            string[] str = new string[Field.Length];
            SqlConnection conn = new SqlConnection(GetSQlConnStr());
            conn.Open();
            SqlCommand comm = new SqlCommand(strSql, conn);
            SqlDataReader read = comm.ExecuteReader();
            if (read.HasRows)
            {
                read.Read();
                for (int i = 0; i < Field.Length; i++)
                {
                    str[i] = read[Field[i]].ToString().Trim();
                }
            }
            else
            {
                str[0] = "-1";
            }
            conn.Close();
            return str;
        }
        public static string GetSQlFieldValue(string strSql)
        {
            string str="-1";
            SqlConnection conn = new SqlConnection(GetSQlConnStr());
            conn.Open();
            SqlCommand comm = new SqlCommand(strSql, conn);
            SqlDataReader read = comm.ExecuteReader();
            while (read.Read())
            {
                str += ","+read["f_id"].ToString().Trim();
            }
            conn.Close();
            return str;
        }
        public static string GetSQlFieldValue_1(string strSql, string Field)
        {
            string str = "";
            SqlConnection conn = new SqlConnection(GetSQlConnStr());
            conn.Open();
            SqlCommand comm = new SqlCommand(strSql, conn);
            SqlDataReader read = comm.ExecuteReader();
            if (read.HasRows)
            {
                read.Read();
                str = read[Field].ToString().Trim();
            }
            else
            {
                str = "";
            }
            conn.Close();
            return str;
        }
        #endregion
        #region //--返回填充的数据集--//
        public static DataSet GetFilledDataSet(string strSQL)
        {
            DataSet dt = new DataSet();
            try
            {
                SqlConnection MyClassConn = new SqlConnection(GetSQlConnStr());
                SqlDataAdapter sda = new SqlDataAdapter(strSQL, MyClassConn);
                sda.Fill(dt);
                return dt;
            }
            catch
            {
                return dt;
            }
        }
        public static DataTable GetFilledDataTable(string strSQL)
        {
            DataTable dt = new DataTable();
            try
            {
                SqlConnection MyClassConn = new SqlConnection(GetSQlConnStr());
                SqlDataAdapter sda = new SqlDataAdapter(strSQL, MyClassConn);
                sda.Fill(dt);
                return dt;
            }
            catch
            {
                return dt;
            }
        }

        public static DataTable GetFilledDataTable_Server(string strSQL)
        {
            DataTable dt = new DataTable();
            try
            {
                SqlConnection MyClassConn = new SqlConnection(GetSQlConnStr());
                SqlDataAdapter sda = new SqlDataAdapter(strSQL, MyClassConn);
                sda.Fill(dt);
                return dt;
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }

        public static void FilledDataTable(string strSQL, DataTable dt)
        {
            try
            {
                SqlConnection MyClassConn = new SqlConnection(GetSQlConnStr());
                SqlDataAdapter sda = new SqlDataAdapter(strSQL, MyClassConn);
                sda.Fill(dt);
                sda.Dispose();
                dt.Dispose();
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }

        public static void FilledDataTable_Server(string strSQL, DataTable dt)
        {
            try
            {
                SqlConnection MyClassConn = new SqlConnection(GetSQlConnStr());
                SqlDataAdapter sda = new SqlDataAdapter(strSQL, MyClassConn);
                sda.Fill(dt);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }

        public static DataTable GetFilledDataTable(string strSQL, SqlConnection conn)
        {
            DataTable dt = new DataTable();
            try
            {
                SqlDataAdapter sda = new SqlDataAdapter(strSQL, conn);
                sda.Fill(dt);
                return dt;
            }
            catch
            {
                return null;
            }
        }

        #endregion
        #region//--数据操作权限判定--//
        public static Boolean GetDataRankAuthority(string UserDataRank, string ObjectDataRank)
        {
            Boolean brhandle = false;
            try
            {
                if (Convert.ToInt16(UserDataRank) <= Convert.ToInt16(ObjectDataRank))
                {
                    brhandle = true;
                }
            }
            catch
            {
            }
            return brhandle;
        }
        public static Boolean GetDataRankManaAuthority(string UserDataRank, string ObjectDataRank)
        {
            Boolean brhandle = false;
            try
            {
                if (Convert.ToInt16(UserDataRank) <= Convert.ToInt16(ObjectDataRank) || UserDataRank == "0")
                {
                    brhandle = true;
                }
            }
            catch
            {
            }
            return brhandle;
        }
        #endregion
        #region//--用户功能权限处理--//
        /// <summary>
        /// 初始化用户功能权限列表
        /// </summary>
        /// <param name="strStuffID">用户ID</param>
        /// <param name="strDepID">部门ID</param>
        /// <param name="strPosID">职位ID</param>
        /// <returns>初始化否成功</returns>
        public static Boolean WriteAuthorityInXml(string strStuffID, string strDepID, string strPosID,string strAuthID)
        {
            string strSQL = "select f_str_0 as f_string from TS_S_T_P_Tree where f_mainid=" + strAuthID + " and f_type=1 and (f_id in (select f_menuid from TS_S_T_S_Tree_Authority where ((f_funcid=" + strStuffID + " and f_type=0) or (f_funcid=" + strPosID + " and f_type=1) or ((f_funcid=" + strDepID + " or f_funcid in (select f_id from TS_S_T_P_Department where f_del=0 and f_level like '%," + strDepID + ",%')) and f_type=2)) and f_del=0) or f_func_0=0) and f_del=0";
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(TS_Win_Class._xml_SysSetting_Filename); //加载XML文档
            try
            {
                XmlNode xmlNode = xmlDoc.SelectSingleNode("//xml_TS_AllInOne//FunctionList");//加载节点
                xmlNode.RemoveAll();//删除权限列表
                XmlNode eltSession = xmlDoc.CreateElement("S374E6C90EF67CF21");
                eltSession.InnerText = "1";
                xmlNode.AppendChild(eltSession);
                SqlConnection conn = new SqlConnection(TS_Win_Class.GetSQlConnStr());
                conn.Open();
                SqlCommand comm = new SqlCommand(strSQL, conn);
                SqlDataReader read = comm.ExecuteReader();
                while (read.Read())
                {
                    eltSession = xmlDoc.CreateElement("S" + DESEncrypt.Encrypt(read["f_string"].ToString().Trim(), TS_Win_Class._xml_SysSetting_CompanyName));
                    eltSession.InnerText = "1";
                    xmlNode.AppendChild(eltSession);
                }
                xmlDoc.Save(TS_Win_Class._xml_SysSetting_Filename);
                conn.Close();
                return true;
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 删除用户本地权限列表
        /// </summary>
        /// <returns>是否成功删除</returns>
        public static Boolean DelAuthorityInXml()
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(TS_Win_Class._xml_SysSetting_Filename); //加载XML文档
            try
            {
                XmlNode xmlNode = xmlDoc.SelectSingleNode("//xml_TS_AllInOne//FunctionList");//加载节点
                xmlNode.RemoveAll();//删除权限列表
                XmlNode eltSession = xmlDoc.CreateElement("S374E6C90EF67CF21");
                eltSession.InnerText = "1";
                xmlNode.AppendChild(eltSession);
                xmlDoc.Save(TS_Win_Class._xml_SysSetting_Filename);
                return true;
            }
            catch
            {
                return false;
            }
        }
        /// <summary>
        /// 获取用户权限授权结果
        /// </summary>
        /// <param name="strString">系统功能标示码</param>
        /// <returns>是否具有权限</returns>
        public static Boolean GetAuthorityInXmlByString(string strString,string strStuffDataRank)
        {
            if (strStuffDataRank == "0")
            {
                return true;
            }
            else
            {
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(TS_Win_Class._xml_SysSetting_Filename); //加载XML文档
                try
                {
                    XmlNode xmlNode = xmlDoc.SelectSingleNode("//xml_TS_AllInOne//FunctionList//" + "S" + DESEncrypt.Encrypt(strString, TS_Win_Class._xml_SysSetting_CompanyName));//加载节点
                    if (xmlNode.InnerText.Trim() == "1")
                    {
                        return true;
                    }
                    else
                    {
                        return false;
                    }
                }
                catch
                {
                    return false;
                }
            }
        }
        #endregion
        #region//--中文简拼--//
        public static string GetChineseSpell(string strText)
        {
            int len = strText.Length;
            string myStr = "";
            for (int i = 0; i < len; i++)
            {
                myStr += getSpell(strText.Substring(i, 1));
            }
            return myStr;
        }
        public static string getSpell(string cnChar)
        {
            byte[] arrCN = Encoding.Default.GetBytes(cnChar);
            if (arrCN.Length > 1)
            {
                int area = (short)arrCN[0];
                int pos = (short)arrCN[1];
                int code = (area << 8) + pos;
                int[] areacode = { 45217, 45253, 45761, 46318, 46826, 47010, 47297, 47614, 48119, 48119, 49062, 49324, 49896, 50371, 50614, 50622, 50906, 51387, 51446, 52218, 52698, 52698, 52698, 52980, 53689, 54481 };
                for (int i = 0; i < 26; i++)
                {
                    int max = 55290;
                    if (i != 25) max = areacode[i + 1];
                    if (areacode[i] <= code && code < max)
                    {
                        return Encoding.Default.GetString(new byte[] { (byte)(65 + i) });
                    }
                }
                return "*";
            }
            else return cnChar;
        }
        #endregion
        #region//--获取星期几字符串--//
        public static string[] _GetWeekString(DateTime _dt)
        {
            string[] _sWeek = { "",""};
            switch ((int)_dt.DayOfWeek)
            {
                case 1:
                    _sWeek[0] = "一";
                    _sWeek[1] = "WhiteSmoke";
                    break;
                case 2:
                    _sWeek[0] = "二";
                    _sWeek[1] = "WhiteSmoke";
                    break;
                case 3:
                    _sWeek[0] = "三";
                    _sWeek[1] = "WhiteSmoke";
                    break;
                case 4:
                    _sWeek[0] = "四";
                    _sWeek[1] = "WhiteSmoke";
                    break;
                case 5:
                    _sWeek[0] = "五";
                    _sWeek[1] = "WhiteSmoke";
                    break;
                case 6:
                    _sWeek[0] = "六";
                    _sWeek[1] = "White";
                    break;
                case 0:
                    _sWeek[0] = "日";
                    _sWeek[1] = "White";
                    break;
                default:
                    _sWeek[0] = "?";
                    _sWeek[1] = "Red";
                    break;
            }
            return _sWeek;
        }
        #endregion
        #region//--遍历GridBand方法--//
        public static void _SetBand(DevExpress.XtraGrid.Views.BandedGrid.GridBand _BD, string _Name, string[] _Caption)
        {
            if (_BD.Name == _Name)
            {
                _BD.Caption = _Caption[0];
                _BD.AppearanceHeader.BackColor = Color.FromName(_Caption[1]);
                _BD.AppearanceHeader.BorderColor = Color.FromName(_Caption[1]);
            }
            else
            {
                foreach (DevExpress.XtraGrid.Views.BandedGrid.GridBand _cl in _BD.Children)
                {
                    _SetBand(_cl, _Name, _Caption);
                }
            }
        }
        public static void _SetBandCaption(DevExpress.XtraGrid.Views.BandedGrid.GridBand _BD, string _Name, string[] _Caption)
        {
            if (_BD.Name == _Name)
            {
                _BD.Caption = _Caption[0];
            }
            else
            {
                foreach (DevExpress.XtraGrid.Views.BandedGrid.GridBand _cl in _BD.Children)
                {
                    _SetBandCaption(_cl, _Name, _Caption);
                }
            }
        }
        public static void _SetBandColor(DevExpress.XtraGrid.Views.BandedGrid.GridBand _BD, string _Name, string[] _Caption)
        {
            if (_BD.Name == _Name)
            {
                _BD.AppearanceHeader.BackColor = Color.FromName(_Caption[1]);
                _BD.AppearanceHeader.BorderColor = Color.FromName(_Caption[1]);
            }
            else
            {
                foreach (DevExpress.XtraGrid.Views.BandedGrid.GridBand _cl in _BD.Children)
                {
                    _SetBandColor(_cl, _Name, _Caption);
                }
            }
        }
        #endregion
        #region//--自动排程方法--//
        public static void Auto_Scheduling_Day(string _LoadID,DateTime _Stime)
        {
            DateTime _UPTime = _Stime;
            string strSQL = "select f_id,f_length,f_order from TS_TR_BU_Work_Main_Day where f_del=0 and f_bmwid=" + _LoadID+" order by f_order,f_id asc";
            SqlConnection conn = new SqlConnection(GetSQlConnStr());
            conn.Open();
            SqlCommand comm = new SqlCommand(strSQL, conn);
            SqlDataReader read = comm.ExecuteReader();
            int i = 0;
            while (read.Read())
            {
                if (i==(int)read["f_order"])
                {
                    strSQL = "update TS_TR_BU_Work_Main_Day set f_pstime='" + _UPTime.GetDateTimeFormats('s')[0].ToString().Substring(0, 10) + " 09:00:00',f_petime='" + _UPTime.AddDays(Convert.ToDouble(read["f_length"].ToString())-1).GetDateTimeFormats('s')[0].ToString().Substring(0, 10) + " 17:00:00' where f_id=" + read["f_id"].ToString();
                }
                else
                {
                    strSQL = "update TS_TR_BU_Work_Main_Day set f_pstime='" + _UPTime.GetDateTimeFormats('s')[0].ToString().Substring(0, 10) + " 09:00:00',f_petime='" + _UPTime.AddDays(Convert.ToDouble(read["f_length"].ToString())-1).GetDateTimeFormats('s')[0].ToString().Substring(0, 10) + " 17:00:00' where f_id=" + read["f_id"].ToString();
                    _UPTime = _UPTime.AddDays(Convert.ToDouble(read["f_length"].ToString()));
                }
                i = (int)read["f_order"];
                TS_Win_Class.MySqlCom(strSQL);
                //Auto_Scheduling_Steps(read["f_id"].ToString());
                strSQL = "update TS_TR_BU_Work_Main_Steps set f_pstime=(select CONVERT(varchar(100),f_pstime, 23) from TS_TR_BU_Work_Main_Day where f_id=TS_TR_BU_Work_Main_Steps.f_bmwdid) + ' ' +CONVERT(varchar(100), f_pstime, 8),f_petime=(select CONVERT(varchar(100),f_petime, 23) from TS_TR_BU_Work_Main_Day where f_id=TS_TR_BU_Work_Main_Steps.f_bmwdid) + ' ' +CONVERT(varchar(100), f_petime, 8) where f_bmwdid=" + read["f_id"].ToString();
                TS_Win_Class.MySqlCom(strSQL);
                strSQL = "update TS_TR_BU_Work_Main_Group set f_pstime=(select CONVERT(varchar(100),f_pstime, 23) from TS_TR_BU_Work_Main_Day where f_id=TS_TR_BU_Work_Main_Group.f_bmwdid) + ' ' +CONVERT(varchar(100), f_pstime, 8),f_petime=(select CONVERT(varchar(100),f_petime, 23) from TS_TR_BU_Work_Main_Day where f_id=TS_TR_BU_Work_Main_Group.f_bmwdid) + ' ' +CONVERT(varchar(100), f_petime, 8) where f_bmwdid=" + read["f_id"].ToString();
                TS_Win_Class.MySqlCom(strSQL);
            }
            conn.Close();
            conn.Dispose();
        }
        public static void Auto_Scheduling_Day_Change(string _LoadID, string _LoadDID, DateTime _Stime)
        {
            DateTime _UPTime = _Stime.AddDays(1);
            string strSQL = "select f_id,f_length,f_order from TS_TR_BU_Work_Main_Day where f_del=0 and f_bmwid=" + _LoadID + " and f_order >(select f_order from TS_TR_BU_Work_Main_Day where f_id="+_LoadDID+") order by f_order,f_id asc";
            SqlConnection conn = new SqlConnection(GetSQlConnStr());
            conn.Open();
            SqlCommand comm = new SqlCommand(strSQL, conn);
            SqlDataReader read = comm.ExecuteReader();
            int i = 0;
            while (read.Read())
            {
                if (i == (int)read["f_order"])
                {
                    strSQL = "update TS_TR_BU_Work_Main_Day set f_pstime='" + _UPTime.GetDateTimeFormats('s')[0].ToString().Substring(0, 10) + " 09:00:00',f_petime='" + _UPTime.AddDays(Convert.ToDouble(read["f_length"].ToString()) - 1).GetDateTimeFormats('s')[0].ToString().Substring(0, 10) + " 17:00:00' where f_id=" + read["f_id"].ToString();
                }
                else
                {
                    strSQL = "update TS_TR_BU_Work_Main_Day set f_pstime='" + _UPTime.GetDateTimeFormats('s')[0].ToString().Substring(0, 10) + " 09:00:00',f_petime='" + _UPTime.AddDays(Convert.ToDouble(read["f_length"].ToString()) - 1).GetDateTimeFormats('s')[0].ToString().Substring(0, 10) + " 17:00:00' where f_id=" + read["f_id"].ToString();
                    _UPTime = _UPTime.AddDays(Convert.ToDouble(read["f_length"].ToString()));
                }
                i = (int)read["f_order"];
                TS_Win_Class.MySqlCom(strSQL);
                //Auto_Scheduling_Steps(read["f_id"].ToString());
                strSQL = "update TS_TR_BU_Work_Main_Steps set f_pstime=(select CONVERT(varchar(100),f_pstime, 23) from TS_TR_BU_Work_Main_Day where f_id=TS_TR_BU_Work_Main_Steps.f_bmwdid) + ' ' +CONVERT(varchar(100), f_pstime, 8),f_petime=(select CONVERT(varchar(100),f_petime, 23) from TS_TR_BU_Work_Main_Day where f_id=TS_TR_BU_Work_Main_Steps.f_bmwdid) + ' ' +CONVERT(varchar(100), f_petime, 8) where f_bmwdid=" + read["f_id"].ToString();
                TS_Win_Class.MySqlCom(strSQL);
                strSQL = "update TS_TR_BU_Work_Main_Group set f_pstime=(select CONVERT(varchar(100),f_pstime, 23) from TS_TR_BU_Work_Main_Day where f_id=TS_TR_BU_Work_Main_Group.f_bmwdid) + ' ' +CONVERT(varchar(100), f_pstime, 8),f_petime=(select CONVERT(varchar(100),f_petime, 23) from TS_TR_BU_Work_Main_Day where f_id=TS_TR_BU_Work_Main_Group.f_bmwdid) + ' ' +CONVERT(varchar(100), f_petime, 8) where f_bmwdid=" + read["f_id"].ToString();
                TS_Win_Class.MySqlCom(strSQL);
            }
            conn.Close();
            conn.Dispose();
        }
        public static void Auto_Scheduling_Steps(string _LoadID)
        {
            string strSQL = "select f_id,f_length,f_order,f_timetype,f_pstime,f_petime from TS_TR_BU_Work_Main_Steps where f_del=0 and f_bmwdid=" + _LoadID + " order by f_order,f_id asc";
            //SqlConnection conn = new SqlConnection(GetSQlConnStr());
            //conn.Open();
            //SqlCommand comm = new SqlCommand(strSQL, conn);
            //SqlDataReader read = comm.ExecuteReader();
            //int i = 0;
            //while (read.Read())
            //{
            //    switch (read["f_timetype"])
            //    {
            //        //case 0:
            //        //    break;
            //        //case 1:
            //        //    break;
            //        //case 2:
            //        //    break;
            //        default:
            //            strSQL = "update TS_TR_BU_Work_Main_Steps set f_pstime=,f_petime=";
            //            break;
            //    }
            //    TS_Win_Class.MySqlCom(strSQL);
            //    Auto_Scheduling_Group(read["f_id"].ToString());
            //}
            //conn.Close();
            //conn.Dispose();
        }
        public static void Auto_Scheduling_Group(string _LoadID)
        {

        }
        public static void Auto_Scheduling(string _BMWID, string _TableStr)
        {
            DateTime sDate = DateTime.Now;
            string strSQL = "update TS_" + _TableStr + "_BU_Work_Main set f_etime=dateadd(mi," + TS_Win_Class.GetSQlFieldValue("select sum(f_length) as f_sum from TS_" + _TableStr + "_BU_Work_Main_Day where f_del=0 and f_bmwid=" + _BMWID, "f_sum") + ",f_stime) where f_del=0 and f_id=" + _BMWID;
            TS_Win_Class.MySqlCom(strSQL);
            strSQL = "select f_id,f_length from TS_" + _TableStr + "_BU_Work_Main_Day where f_del=0 and f_bmwid=" + _BMWID;
            SqlConnection conn = new SqlConnection(GetSQlConnStr());
            conn.Open();
            SqlCommand comm = new SqlCommand(strSQL, conn);
            SqlDataReader read = comm.ExecuteReader();
            int i = 0;
            while (read.Read())
            {
                if (i == 0)
                {
                    sDate = Convert.ToDateTime(TS_Win_Class.GetSQlFieldValue("select f_stime from TS_" + _TableStr + "_BU_Work_Main where f_id=" + _BMWID, "f_stime"));
                }
                strSQL = "update TS_" + _TableStr + "_BU_Work_Main_Day set f_stime='" + sDate.GetDateTimeFormats('g')[0].ToString() + "',f_etime='" + sDate.AddMinutes(Convert.ToDouble(read["f_length"].ToString())).GetDateTimeFormats('g')[0].ToString() + "' where f_id=" + read["f_id"].ToString();
                TS_Win_Class.MySqlCom(strSQL);
                strSQL = "update TS_" + _TableStr + "_BU_Work_Main_Steps set f_stime=(select f_stime from TS_" + _TableStr + "_BU_Work_Main_Day where f_id=TS_" + _TableStr + "_BU_Work_Main_Steps.f_bmwdid),f_etime=(select f_etime from TS_" + _TableStr + "_BU_Work_Main_Day where f_id=TS_" + _TableStr + "_BU_Work_Main_Steps.f_bmwdid) where f_bmwdid=" + read["f_id"].ToString();
                TS_Win_Class.MySqlCom(strSQL);
                strSQL = "update TS_" + _TableStr + "_BU_Work_Main_Group set f_stime=(select f_stime from TS_" + _TableStr + "_BU_Work_Main_Day where f_id=TS_" + _TableStr + "_BU_Work_Main_Group.f_bmwdid),f_etime=(select f_etime from TS_" + _TableStr + "_BU_Work_Main_Day where f_id=TS_" + _TableStr + "_BU_Work_Main_Group.f_bmwdid) where f_bmwdid=" + read["f_id"].ToString();
                TS_Win_Class.MySqlCom(strSQL);
                strSQL = "update TS_" + _TableStr + "_BU_Work_Main_Group_WorkPlace set f_ctime=(select f_stime from TS_" + _TableStr + "_BU_Work_Main_Day where f_id=TS_" + _TableStr + "_BU_Work_Main_Group_WorkPlace.f_bmwdid) where f_bmwdid=" + read["f_id"].ToString();
                TS_Win_Class.MySqlCom(strSQL);
                sDate = sDate.AddMinutes(Convert.ToDouble(read["f_length"].ToString()));

                //strSQL = "update TS_"+_TableStr+"_BU_Work_Main_Steps set f_stime='" + sDate.GetDateTimeFormats('s')[0].ToString().Substring(0, 10) + " 09:00:00',f_etime='" + sDate.AddDays(Convert.ToDouble(read["f_length"].ToString())).GetDateTimeFormats('s')[0].ToString().Substring(0, 10) + " 17:00:00' where f_bmwdid=" + read["f_id"].ToString();
                //TS_Win_Class.MySqlCom(strSQL);
                //strSQL = "update TS_"+_TableStr+"_BU_Work_Main_Group set f_stime='" + sDate.GetDateTimeFormats('s')[0].ToString().Substring(0, 10) + " 09:00:00' where f_bmwdid=" + read["f_id"].ToString();
                //TS_Win_Class.MySqlCom(strSQL);
                //strSQL = "update TS_"+_TableStr+"_BU_Work_Main_Group set f_etime=dateadd(mi,f_length*60,f_stime) where f_bmwdid=" + read["f_id"].ToString();
                //TS_Win_Class.MySqlCom(strSQL);
                //strSQL = "update TS_"+_TableStr+"_BU_Work_Main_Group_WorkPlace set f_ctime=(select f_etime from TS_"+_TableStr+"_BU_Work_Main_Group where f_id=TS_"+_TableStr+"_BU_Work_Main_Group_WorkPlace.f_bmwgid) where f_bmwdid=" + read["f_id"].ToString();
                //TS_Win_Class.MySqlCom(strSQL);
                //sDate = sDate.AddDays(Convert.ToDouble(read["f_length"].ToString()) + 1);
                i++;
            }
            conn.Close();
        }
        #endregion
        #region//--记名检修报表方法--//
        public static void GetRepotAuthority(WIN_RegisterReport_OBJ _obj, DevExpress.XtraEditors.XtraForm _form)
        {
            string strSQL = "select f_id,f_fieldname,(select count(*) from TS_S_T_P_Report_Authority where f_del=0 and f_filedid=TS_S_T_P_Report_Field.f_id and ((f_type=0 and f_funcid=" + TS_Win_Locomotive_MainForm.pUserInfoMain.GuId + ") or (f_type=1 and f_funcid=" + TS_Win_Locomotive_MainForm.pUserInfoMain.UserPosID + ") or (f_type=2 and f_funcid=" + TS_Win_Locomotive_MainForm.pUserInfoMain.UserDepIndex + "))) as f_count from TS_S_T_P_Report_Field where f_del=0 and f_atype=1 and f_rmid=" + _obj._sRMID;
            SqlConnection conn = new SqlConnection(GetSQlConnStr());
            conn.Open();
            SqlCommand comm = new SqlCommand(strSQL, conn);
            SqlDataReader read = comm.ExecuteReader();
            while (read.Read())
            {
                if (read["f_count"].ToString() == "0")
                {
                    _form.Controls.Find(read["f_fieldname"].ToString(), true)[0].Enabled = false;
                }
                else
                {
                    _form.Controls.Find(read["f_fieldname"].ToString(), true)[0].Enabled = true;
                }
            }
            conn.Close();
        }
        #endregion
        #region//--自动计算检修过程完成与否--//
        public static void _AutoSumWorkMainDataFinish(string _RType,string _RID,string _WorkerID)
        {
            string strSQL = "";
            switch (_RType)
            {
                case "W":
                    //项点派发的自互检项目是否都完成
                    if (TS_Win_Class.GetSQlFieldValue("select count(*) as f_count from TS_TR_BU_Work_Main_Relation where f_rtype in (4,5) and f_ftype=0 and f_rid=" + _RID + " and f_state in (0,1)", "f_count") == "0")
                    {
                        strSQL = "update TS_TR_BU_Work_Main_Group_WorkPlace set f_state=(select top 1 f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state=9) where f_id=" + _RID;
                        //MessageBox.Show(strSQL);
                        TS_Win_Class.MySqlCom(strSQL);
                        //项点对应的作业组下的项点是否都完成
                        if (TS_Win_Class.GetSQlFieldValue("select count(*) as f_count from TS_TR_BU_Work_Main_Group_WorkPlace where f_bmwgid=(select f_bmwgid from TS_TR_BU_Work_Main_Group_WorkPlace where f_id="+_RID+ ") and f_state in (select f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state<>9) and f_del=0", "f_count") == "0")
                        {
                            strSQL = "update TS_TR_BU_Work_Main_Group set f_state=(select top 1 f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state=9),f_etime=getdate() where f_id=(select f_bmwgid from TS_TR_BU_Work_Main_Group_WorkPlace where f_id=" + _RID + ") and f_state in (select f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state<>9)";
                            strSQL += ";update TS_TR_BU_Work_Main_Relation set f_state=9,f_etime=getdate(),f_estuffid=f_stuffid where f_rid=(select f_bmwgid from TS_TR_BU_Work_Main_Group_WorkPlace where f_id=" + _RID + ") and f_rtype=3 and f_ftype=2 and f_state<>9 and f_del=0";
                            TS_Win_Class.MySqlCom(strSQL);
                            //项点对应的作业工步下的作业组是否都已经完工
                            if (TS_Win_Class.GetSQlFieldValue("select count(*) as f_count from TS_TR_BU_Work_Main_Group where f_bmwsid=(select f_bmwsid from TS_TR_BU_Work_Main_Group_WorkPlace where f_id=" + _RID + ") and f_state in (select f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state<>9) and f_del=0", "f_count") == "0")
                            {
                                strSQL = "update TS_TR_BU_Work_Main_Steps set f_state=(select top 1 f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state=9),f_etime=getdate() where f_id=(select f_bmwsid from TS_TR_BU_Work_Main_Group_WorkPlace where f_id=" + _RID + ") and f_state in (select f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state<>9)";
                                strSQL += ";update TS_TR_BU_Work_Main_Relation set f_state=9,f_etime=getdate(),f_estuffid=f_stuffid where f_rid=(select f_bmwsid from TS_TR_BU_Work_Main_Group_WorkPlace where f_id=" + _RID + ") and f_rtype=2 and f_ftype=2 and f_state<>9 and f_del=0";
                                TS_Win_Class.MySqlCom(strSQL);
                                //项点对应的作业工序下的作业工步是否都已经完工
                                if (TS_Win_Class.GetSQlFieldValue("select count(*) as f_count from TS_TR_BU_Work_Main_Steps where f_bmwdid=(select f_bmwdid from TS_TR_BU_Work_Main_Group_WorkPlace where f_id=" + _RID + ") and f_state in (select f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state<>9) and f_del=0", "f_count") == "0")
                                {
                                    strSQL = "update TS_TR_BU_Work_Main_Day set f_state=(select top 1 f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state=9),f_etime=getdate() where f_id=(select f_bmwdid from TS_TR_BU_Work_Main_Group_WorkPlace where f_id=" + _RID + ") and f_state in (select f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state<>9)";
                                    strSQL += ";update TS_TR_BU_Work_Main_Relation set f_state=9,f_etime=getdate(),f_estuffid=f_stuffid where f_rid=(select f_bmwdid from TS_TR_BU_Work_Main_Group_WorkPlace where f_id=" + _RID + ") and f_rtype=1 and f_ftype=2 and f_state<>9 and f_del=0";
                                    TS_Win_Class.MySqlCom(strSQL);
                                }
                            }
                        }
                    }
                    break;
                case "G":
                    //作业组对应的作业工步下的作业组是否都已经完工
                    if (TS_Win_Class.GetSQlFieldValue("select count(*) as f_count from TS_TR_BU_Work_Main_Group where f_bmwsid=(select f_bmwsid from TS_TR_BU_Work_Main_Group where f_id=" + _RID + ") and f_state in (select f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state<>9) and f_del=0", "f_count") == "0")
                    {
                        strSQL = "update TS_TR_BU_Work_Main_Steps set f_state=(select top 1 f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state=9),f_etime=getdate() where f_id=(select f_bmwsid from TS_TR_BU_Work_Main_Group where f_id=" + _RID + ") and f_state in (select f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state<>9)";
                        strSQL += ";update TS_TR_BU_Work_Main_Relation set f_state=9,f_etime=getdate(),f_estuffid=f_stuffid where f_rid=(select f_bmwsid from TS_TR_BU_Work_Main_Group where f_id=" + _RID + ") and f_rtype=2 and f_ftype=2 and f_state<>9 and f_del=0";
                        TS_Win_Class.MySqlCom(strSQL);
                        //作业组对应的作业工序下的作业工步是否都已经完工
                        if (TS_Win_Class.GetSQlFieldValue("select count(*) as f_count from TS_TR_BU_Work_Main_Steps where f_bmwdid=(select f_bmwdid from TS_TR_BU_Work_Main_Group where f_id=" + _RID + ") and f_state in (select f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state<>9) and f_del=0", "f_count") == "0")
                        {
                            strSQL = "update TS_TR_BU_Work_Main_Day set f_state=(select top 1 f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state=9),f_etime=getdate() where f_id=(select f_bmwdid from TS_TR_BU_Work_Main_Group where f_id=" + _RID + ") and f_state in (select f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state<>9)";
                            strSQL += ";update TS_TR_BU_Work_Main_Relation set f_state=9,f_etime=getdate(),f_estuffid=f_stuffid where f_rid=(select f_bmwdid from TS_TR_BU_Work_Main_Group where f_id=" + _RID + ") and f_rtype=1 and f_ftype=2 and f_state<>9 and f_del=0";
                            TS_Win_Class.MySqlCom(strSQL);
                        }
                    }
                    break;
                case "S":
                    //作业工步对应的作业工序下的作业工步是否都已经完工
                    if (TS_Win_Class.GetSQlFieldValue("select count(*) as f_count from TS_TR_BU_Work_Main_Steps where f_bmwdid=(select f_bmwdid from TS_TR_BU_Work_Main_Steps where f_id=" + _RID + ") and f_state in (select f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state<>9) and f_del=0", "f_count") == "0")
                    {
                        strSQL = "update TS_TR_BU_Work_Main_Day set f_state=(select top 1 f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state=9),f_etime=getdate() where f_id=(select f_bmwdid from TS_TR_BU_Work_Main_Steps where f_id=" + _RID + ") and f_state in (select f_id from TS_S_T_S_RP_DataState where f_del=0 and f_state<>9)";
                        strSQL += ";update TS_TR_BU_Work_Main_Relation set f_state=9,f_etime=getdate(),f_estuffid=f_stuffid where f_rid=(select f_bmwdid from TS_TR_BU_Work_Main_Steps where f_id=" + _RID + ") and f_rtype=1 and f_ftype=2 and f_state<>9 and f_del=0";
                        TS_Win_Class.MySqlCom(strSQL);
                    }
                    break;
                default:
                    break;
            }
        }
        #endregion
        public static string CutLast0(string str)
        {
            string _str = str;
            if (_str.IndexOf('.') > -1)
            {
                while (_str.LastIndexOf("0") == _str.Length - 1)
                {
                    _str = _str.Substring(0, _str.Length - 1);
                }
                if (_str.LastIndexOf(".") == _str.Length - 1)
                {
                    _str = _str.Substring(0, _str.Length - 1);
                }
            }
            return _str;
        }
        public static string GetUpDepID(string strLevel)
        {
            string sID = "";
            while (strLevel.Trim().Length > 1)
            {
                if (strLevel.Trim() == ",")
                {
                }
                else
                {
                    if (strLevel.Substring(0, 1) == ",")
                    {
                        sID = "";
                    }
                    else
                    {
                        sID += strLevel.Substring(0, 1);
                    }
                    strLevel = strLevel.Substring(1);
                }
            }
            return sID;
        }
        public static string GetTopDepID(string strLevel)
        {
            string sID = "";
            sID=strLevel.Substring(1);
            sID = sID.Substring(0, sID.IndexOf(','));
            return sID;
        }
    }
    #region <<--用户登录基本信息类UserSettings
    /// <summary>
    /// 尹湘立 2012-11-15 用户登录基本信息类
    /// </summary>
    public class UserSettings
    {
        //本身
        private static UserSettings _instance = null;
        //员工标示号
        private Boolean _userLoginState = false;
        //员工标示号
        private string _guId = string.Empty;
        //登录工号
        private string _userCode = string.Empty;
        //隶属一级部门号
        private string _userDepTopID = string.Empty;
        //登录部门号
        private string _userDepIndex = string.Empty;
        //登录部门名称
        private string _userDepName = string.Empty;
        //登录职位号
        private string _userPosID = string.Empty;
        //登录职位名称
        private string _userPosName = string.Empty;
        //用户真名
        private string _userName = string.Empty;
        //登录密码
        private string _password = string.Empty;
        //登录IP
        private string _loginIp = string.Empty;
        //登录时间
        private string _loginTime = string.Empty;
        //是否连线
        private bool _isOnLine = true;
        private int f_netField = 0;
        //站段编号
        private string _userRSID = string.Empty;
        //站段名称
        private string _userRSName = string.Empty;
        //登录局ID
        private string _userRBID = string.Empty;
        //登录局名称
        private string _userRBName = string.Empty;
        //数据授权ID
        private string _userDataRangID = string.Empty;

        public UserSettings()
        {
        }

        //获取登录基本信息
        public static UserSettings Instance
        {
            get { return _instance; }
            set { _instance = (UserSettings)value; }
        }
        //员工标示号
        public Boolean UserLoginState
        {
            get { return _userLoginState; }
            set { _userLoginState = value; }
        }

        //员工标示号
        public string GuId
        {
            get { return _guId; }

            set { _guId = value; }
        }

        //登录工号
        public string UserCode
        {
            get { return _userCode; }

            set { _userCode = value; }
        }
        //隶属一级部门号
        public string UserDepTopID
        {
            get { return _userDepTopID; }

            set { _userDepTopID = value; }
        }
        //登录部门号
        public string UserDepIndex
        {
            get { return _userDepIndex; }

            set { _userDepIndex = value; }
        }

        //登录部门名称
        public string UserDepName
        {
            get { return _userDepName; }

            set { _userDepName = value; }
        }
        //登录职位号
        public string UserPosID
        {
            get { return _userPosID; }

            set { _userPosID = value; }
        }

        //登录职位名称
        public string UserPosName
        {
            get { return _userPosName; }

            set { _userPosName = value; }
        }

        //用户真名
        public string Username
        {
            get { return _userName; }

            set { _userName = value; }
        }

        //密码
        public string Password
        {
            get { return _password; }

            set { _password = value; }
        }

        //登录IP
        public string LoginIp
        {
            get { return _loginIp; }

            set { _loginIp = value; }
        }

        //登录时间
        public string LoginTime
        {
            get { return _loginTime; }

            set { _loginTime = value; }
        }

        //工作是否末连线
        public bool IsOnLine
        {
            get { return _isOnLine; }

            set { _isOnLine = value; }
        }
        public int NetField
        {
            get { return f_netField; }
            set { f_netField = value; }
        }
        //站段编号
        public string UserRSID
        {
            get { return _userRSID; }

            set { _userRSID = value; }
        }
        //站段名称
        public string UserRSName
        {
            get { return _userRSName; }

            set { _userRSName = value; }
        }
        //登录局ID
        public string UserRBID
        {
            get { return _userRBID; }

            set { _userRBID = value; }
        }
        //登录局名称
        public string UserRBName
        {
            get { return _userRBName; }

            set { _userRBName = value; }
        }
        //数据授权ID
        public string UserDataRankID
        {
            get { return _userDataRangID; }

            set { _userDataRangID = value; }
        }
    }

    #endregion
    #region <<--加密算法 DESEncrypt
    public class DESEncrypt
    {
        public DESEncrypt()
        { }
        #region =========加密===========
        /// <summary>
        /// 加密
        /// </summary>
        /// <param name="Text"></param>
        /// <returns></returns>
        public string Encrypt(string Text)
        {
            TS_Win_Class sps = new TS_Win_Class();
            return Encrypt(Text, sps.GetCompanyName());
        }

        /// <summary>
        /// 加密数据
        /// </summary>
        /// <param name="Text"></param>
        /// <param name="sKey"></param>
        /// <returns></returns>
        public static string Encrypt(string Text, string sKey)
        {
            DESCryptoServiceProvider des = new DESCryptoServiceProvider();
            byte[] inputByteArray;
            inputByteArray = Encoding.Default.GetBytes(Text);
            des.Key = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
            des.IV = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
            System.IO.MemoryStream ms = new System.IO.MemoryStream();
            CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(), CryptoStreamMode.Write);
            cs.Write(inputByteArray, 0, inputByteArray.Length);
            cs.FlushFinalBlock();
            StringBuilder ret = new StringBuilder();
            foreach (byte b in ms.ToArray())
            {
                ret.AppendFormat("{0:X2}", b);
            }
            return ret.ToString();
        }
        #endregion
        #region =======解密==================
        /// <summary>
        /// 解密
        /// </summary>
        /// <param name="Text"></param>
        /// <returns></returns>
        public string Decrypt(string Text)
        {
            TS_Win_Class sps = new TS_Win_Class();

            return Decrypt(Text, sps.GetCompanyName());
        }
        /// <summary>
        /// 解密数据
        /// </summary>
        /// <param name="Text"></param>
        /// <param name="sKey"></param>
        /// <returns></returns>
        public static string Decrypt(string Text, string sKey)
        {
            DESCryptoServiceProvider des = new DESCryptoServiceProvider();
            int len;
            len = Text.Length / 2;
            byte[] inputByteArray = new byte[len];
            int x, i;
            for (x = 0; x < len; x++)
            {
                i = Convert.ToInt32(Text.Substring(x * 2, 2), 16);
                inputByteArray[x] = (byte)i;
            }
            des.Key = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
            des.IV = ASCIIEncoding.ASCII.GetBytes(System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(sKey, "md5").Substring(0, 8));
            System.IO.MemoryStream ms = new System.IO.MemoryStream();
            CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Write);
            cs.Write(inputByteArray, 0, inputByteArray.Length);
            cs.FlushFinalBlock();
            return Encoding.Default.GetString(ms.ToArray());
        }
        #endregion
        #region
        /// <summary>
        /// MD5加密
        /// </summary>
        /// <param name="str">要加密的字符串</param>
        /// <returns></returns>
        public string md5(string str)
        {
            return System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "MD5");
        }
        #endregion
    }
    #endregion
}
#region//--SQL服务器连接--//
namespace GetSQLConnString
{
    public class GetSQLConnString
    {
        private static GetSQLConnString _CurrentSQLConnnString;
        private static String _SQLConnnString;
        public String getConnnString()
        {
            return _SQLConnnString;
        }
        public void setConnnString(String strSQLConnnString)
        {
            _SQLConnnString = strSQLConnnString;
        }

        public static GetSQLConnString getSQLConnString()
        {
            return _CurrentSQLConnnString;
        }

        public static void SetSQLConnString(GetSQLConnString user)
        {
            _CurrentSQLConnnString = user;
        }
    }
}
#endregion
#region//--系统参数定义--//
public class GetSysSettings
{
    public GetSysSettings() { }
    //授权表ID
    private string _sWinFormAuth = string.Empty;
    public string _GetWinFormAuth { get { return _sWinFormAuth; } set { _sWinFormAuth = value; } }
    //当前路局ID
    private string _sNowRailwayBureau = string.Empty;
    public string _GetRailwayBureau { get { return _sNowRailwayBureau; } set { _sNowRailwayBureau = value; } }
    //当前站段ID
    private string _sNowRailwayStations = string.Empty;
    public string _GetRailwayStations { get { return _sNowRailwayStations; } set { _sNowRailwayStations = value; } }
}
#endregion
#region//--本地设置参数调取--//
namespace GetLocalSetting
{
    public class GetLocalSetting
    {
        private static GetLocalSetting _CurrentLocalSetting;
        private static Boolean _Link_OK, _Link_Test_Finish, _Net_AutoDetect;
        public Boolean get_Link_OK()
        {
            return _Link_OK;
        }
        public Boolean get_Link_Test_Finish()
        {
            return _Link_Test_Finish;
        }
        public Boolean get_Net_AutoDetect()
        {
            return _Net_AutoDetect;
        }
        public void set_Net_AutoDetect(Boolean b_Net_AutoDetect)
        {
            _Net_AutoDetect = b_Net_AutoDetect;
        }
        public void set_Link_OK(Boolean b_Link_OK)
        {
            _Link_OK = b_Link_OK;
        }
        public void set_Link_Test_Finish(Boolean b_Link_Test_Finish)
        {
            _Link_Test_Finish = b_Link_Test_Finish;
        }
        public static GetLocalSetting getLocalSetting()
        {
            return _CurrentLocalSetting;
        }

        public static void SetLocalSetting(GetLocalSetting user)
        {
            _CurrentLocalSetting = user;
        }
    }
}
#endregion
#region //--Level类型数据SysTreeMain构造类--//
public class LeverString_SysTreeMainList
{
    public LeverString_SysTreeMainList()
    {
    }
    //ID字段变量
    private string m_sID = string.Empty;
    //名称字段变量
    private string m_sName = "-";
    private string m_sName_1 = "-";
    private string m_sCode = "-";
    //父节点ID变量
    private string m_sParentID = "-1";
    //节点Level变量
    private string m_sLevel = ",";
    //节点Deep变量
    private string m_sDeep = "0";
    //节点Type变量
    private string m_sType = "0";
    //节点Imgindex变量
    private int m_sImgindex = 0;
    private int m_sNum= 0;
    private string m_sStr_0 = "-";
    private int m_sStack = 0;
    private string m_sStr_1 = "-";
    private string m_sStr_2 = "-";
    private string m_sFunc_0 = ",";
    private string m_sFunc_1 = ",";
    private string m_sFunc_2 = ",";
    private string m_sMainid = "-1";
    private Boolean m_CK = false;
    private string m_sSTIME = "";
    private string m_sETIME = "";
    private string m_sSTATE = "0";
    private string m_sCount = "0";
    public string f_count { get { return m_sCount; } set { m_sCount = value; } }
    public string f_stime { get { return m_sSTIME; } set { m_sSTIME = value; } }
    public string f_etime { get { return m_sETIME; } set { m_sETIME = value; } }
    public string f_state { get { return m_sSTATE; } set { m_sSTATE = value; } }
    public Boolean f_ck { get { return m_CK; } set { m_CK = value; } }
    public string f_id { get { return m_sID; } set { m_sID = value; } }
    public string f_name { get { return m_sName; } set { m_sName = value; } }
    public string f_name_1 { get { return m_sName_1; } set { m_sName_1 = value; } }
    public string f_code { get { return m_sCode; } set { m_sCode = value; } }
    public string f_parent { get { return m_sParentID; } set { m_sParentID = value; } }
    public string f_level { get { return m_sLevel; } set { m_sLevel = value; } }
    public string f_deep { get { return m_sDeep; } set { m_sDeep = value; } }
    public string f_type { get { return m_sType; } set { m_sType = value; } }
    public int f_imgindex { get { return m_sImgindex; } set { m_sImgindex = value; } }
    public string f_mainid { get { return m_sMainid; } set { m_sMainid = value; } }
    public int f_num { get { return m_sNum; } set { m_sNum = value; } }
    public int f_stack { get { return m_sStack; } set { m_sStack = value; } }
    public string f_str_0 { get { return m_sStr_0; } set { m_sStr_0 = value; } }
    public string f_str_1 { get { return m_sStr_1; } set { m_sStr_1 = value; } }
    public string f_str_2 { get { return m_sStr_2; } set { m_sStr_2 = value; } }
    public string f_func_0 { get { return m_sFunc_0; } set { m_sFunc_0 = value; } }
    public string f_func_1 { get { return m_sFunc_1; } set { m_sFunc_1 = value; } }
    public string f_func_2 { get { return m_sFunc_2; } set { m_sFunc_2 = value; } }
}
#endregion
#region//--组织结构SysOrganization构造类--//
public class LeverString_SysOrganization
{
    public LeverString_SysOrganization()
    {
    }
    //ID字段变量
    private string m_sID = string.Empty;
    //名称字段变量
    private string m_sName = "-";
    private string m_sCode = "-";
    //父节点ID变量
    private string m_sParentID = "-1";
    //节点Level变量
    private string m_sLevel = ",";
    //节点Deep变量
    private string m_sDeep = "0";
    //节点路局变量
    private string m_sRB = "0";
    //节点站段变量
    private string m_sRS = "0";
    //节点部门变量
    private string m_sDep = "0";
    //节点职位变量
    private string m_sPos = "0";
    //节点选择变量
    private bool m_sCK = false;
    //节点Imgindex变量
    private int m_sImgindex = 0;
    private string m_type = "-1";
    private string m_PID = "-1";
    private string m_stack = "-1";
    private string m_stacknum = "-1";
    public string f_pid { get { return m_PID; } set { m_PID = value; } }
    public string f_type { get { return m_type; } set { m_type = value; } }
    public string f_stack { get { return m_stack; } set { m_stack = value; } }
    public string f_stacknum { get { return m_stacknum; } set { m_stacknum = value; } }

    public string f_id { get { return m_sID; } set { m_sID = value; } }
    public string f_name { get { return m_sName; } set { m_sName = value; } }
    public string f_code { get { return m_sCode; } set { m_sCode = value; } }
    public string f_parent { get { return m_sParentID; } set { m_sParentID = value; } }
    public string f_level { get { return m_sLevel; } set { m_sLevel = value; } }
    public string f_deep { get { return m_sDeep; } set { m_sDeep = value; } }
    public string f_rbid { get { return m_sRB; } set { m_sRB = value; } }
    public string f_rsid { get { return m_sRS; } set { m_sRS = value; } }
    public string f_depid { get { return m_sDep; } set { m_sDep = value; } }
    public string f_posid { get { return m_sPos; } set { m_sPos = value; } }
    public bool f_ck { get { return m_sCK; } set { m_sCK = value; } }
    public int f_imgindex { get { return m_sImgindex; } set { m_sImgindex = value; } }
}
#endregion
#region //--Level类型数据TrainDepSysList构造类--//
public class LeverString_TrainDepSysList
{
    public LeverString_TrainDepSysList()
    {
    }
    //ID字段变量
    private string m_sID = string.Empty;
    //名称字段变量
    private string m_sName = "";
    private string m_sTCID = "";
    private string m_sTTID = "";
    private string m_sTDID = "";
    private string m_sName1 = "";
    private string m_sCode = "";
    //父节点ID变量
    private string m_sParentID = "-1";
    //节点Level变量
    private string m_sLevel = ",";
    //节点Deep变量
    private string m_sDeep = "0";
    //节点Type变量
    private string m_sTrainType = "0";
    //节点Imgindex变量
    private int m_sImgindex = 0;
    private string m_sNum = "";
    private int m_sNumCurent = 0;
    private int m_sNumInstall = 0;
    private int m_sNumRemove = 0;
    private string m_sIndate = "";
    private string m_sType = "";
    private string m_sTypeName = "";

    public string f_id { get { return m_sID; } set { m_sID = value; } }
    public string f_name { get { return m_sName; } set { m_sName = value; } }
    public string f_tcid { get { return m_sTCID; } set { m_sTCID = value; } }
    public string f_ttid { get { return m_sTTID; } set { m_sTTID = value; } }
    public string f_tdid { get { return m_sTDID; } set { m_sTDID = value; } }
    public string f_name1 { get { return m_sName1; } set { m_sName1 = value; } }
    public string f_code { get { return m_sCode; } set { m_sCode = value; } }
    public string f_parent { get { return m_sParentID; } set { m_sParentID = value; } }
    public string f_level { get { return m_sLevel; } set { m_sLevel = value; } }
    public string f_deep { get { return m_sDeep; } set { m_sDeep = value; } }
    public string f_traintype { get { return m_sTrainType; } set { m_sTrainType = value; } }
    public int f_imgindex { get { return m_sImgindex; } set { m_sImgindex = value; } }
    public string f_num { get { return m_sNum; } set { m_sNum = value; } }
    public int f_numcurrent { get { return m_sNumCurent; } set { m_sNumCurent = value; } }
    public int f_numinstall { get { return m_sNumInstall; } set { m_sNumInstall = value; } }
    public int f_numremove { get { return m_sNumRemove; } set { m_sNumRemove = value; } }
    public string f_indate { get { return m_sIndate; } set { m_sIndate = value; } }
    public string f_type { get { return m_sType; } set { m_sType = value; } }
    public string f_typename { get { return m_sTypeName; } set { m_sTypeName = value; } }
}
#endregion
#region //--作业流程构造类--//
public class TR_PS_Work_Main_List
{
    public TR_PS_Work_Main_List()
    {
    }
    //ID字段变量
    private string m_sID = string.Empty;
    //名称字段变量
    private string m_sName = "-";
    //父节点ID变量
    private string m_sParentID = "-1";
    //节点Type变量
    private string m_sType = "0";
    //节点Imgindex变量
    private int m_sImgindex = 0;
    private string m_sLength = "";
    private string m_sOrder = "0";
    private string m_sRPid = "-";
    private string m_sFuncid_1 = "-";
    private string m_sFuncid_2 = ",";
    private string m_sStime = "";
    private string m_sEtime = "";
    private string m_sMWID = "-1";
    private string m_sMWDID = "-1";
    private string m_sMWSID = "-1";
    private string m_sMWGID = "-1";
    private string m_sPStime = "";
    private string m_sPEtime = "";
    private string m_sBMWID = "-1";
    private string m_sBMWDID = "-1";
    private string m_sBMWSID = "-1";
    private string m_sBMWGID = "-1";
    private Boolean m_bCK = false;
    public Boolean f_ck { get { return m_bCK; } set { m_bCK = value; } }
    public string f_id { get { return m_sID; } set { m_sID = value; } }
    public string f_name { get { return m_sName; } set { m_sName = value; } }
    public string f_rpid { get { return m_sRPid; } set { m_sRPid = value; } }
    public string f_parent { get { return m_sParentID; } set { m_sParentID = value; } }
    public string f_length { get { return m_sLength; } set { m_sLength = value; } }
    public string f_order { get { return m_sOrder; } set { m_sOrder = value; } }
    public string f_type { get { return m_sType; } set { m_sType = value; } }
    public int f_imgindex { get { return m_sImgindex; } set { m_sImgindex = value; } }
    public string f_funcid_1 { get { return m_sFuncid_1; } set { m_sFuncid_1 = value; } }
    public string f_funcid_2 { get { return m_sFuncid_2; } set { m_sFuncid_2 = value; } }
    public string f_stime { get { return m_sStime; } set { m_sStime = value; } }
    public string f_etime { get { return m_sEtime; } set { m_sEtime = value; } }
    public string f_mwid { get { return m_sMWID; } set { m_sMWID = value; } }
    public string f_mwdid { get { return m_sMWDID; } set { m_sMWDID = value; } }
    public string f_mwsid { get { return m_sMWSID; } set { m_sMWSID = value; } }
    public string f_mwgid { get { return m_sMWGID; } set { m_sMWGID = value; } }
    public string f_pstime { get { return m_sPStime; } set { m_sPStime = value; } }
    public string f_petime { get { return m_sPEtime; } set { m_sPEtime = value; } }
    public string f_bmwid { get { return m_sBMWID; } set { m_sBMWID = value; } }
    public string f_bmwdid { get { return m_sBMWDID; } set { m_sBMWDID = value; } }
    public string f_bmwsid { get { return m_sBMWSID; } set { m_sBMWSID = value; } }
    public string f_bmwgid { get { return m_sBMWGID; } set { m_sBMWGID = value; } }
}
#endregion
#region //--在线机车TreeList构造类--//
public class TrainInRepairTreeList
{
    public TrainInRepairTreeList()
    {

    }
    //ID字段变量
    private string m_sID = string.Empty;
    //名称字段变量
    private string m_sName = "-";
    //父节点ID变量
    private string m_sParentID = "-1";
    //节点Type变量
    private string m_sRPname = "";
    private string m_sPstime = "";
    //节点Imgindex变量
    private int m_sImgindex = 0;
    private int m_sPercent = 0;
    public string f_id { get { return m_sID; } set { m_sID = value; } }
    public string f_name { get { return m_sName; } set { m_sName = value; } }
    public string f_rpname { get { return m_sRPname; } set { m_sRPname = value; } }
    public string f_parent { get { return m_sParentID; } set { m_sParentID = value; } }
    public string f_pstime { get { return m_sPstime; } set { m_sPstime = value; } }
    public int f_imgindex { get { return m_sImgindex; } set { m_sImgindex = value; } }
    public int f_percent { get { return m_sPercent; } set { m_sPercent = value; } }
}
#endregion
#region//--检修报表传递属性定义--//
public class WIN_RegisterReport_OBJ
{
    public WIN_RegisterReport_OBJ()
    {
    }
    public string _sBMWID { get; set; }
    public string _sRMID { get; set; }
    public string _sMainID { get; set; }
}
public class WIN_RegisterReportControll_OBJ
{
    public WIN_RegisterReportControll_OBJ()
    {
    }
    public string _sTrainNameField { get; set; }
    public string _sRPNameField { get; set; }
}
#endregion
#region //--检修作业填报构造类--//
public class TR_BU_Work_DataComplete_List
{
    public TR_BU_Work_DataComplete_List()
    {
    }
    //ID字段变量
    private string m_sID = string.Empty;
    //名称字段变量
    private string m_sName = "-";
    //父节点ID变量
    private string m_sParentID = "-1";
    //节点Type变量
    private string m_sType = "节点";
    private string m_sTypeName = "";
    //节点Imgindex变量
    private int m_sPercent = 0;
    private int m_sOutTime = 0;
    private int m_sOutTime0 = 0;
    private int m_sOutTime1 = 0;
    private int m_sOutTime2 = 0;
    private string m_sCount = "0";
    private string m_sColor = "White";
    private string m_sBrief = "";
    private string m_sStuff0 = "";
    private string m_sTime0 = "";
    private string m_sStuff1 = "";
    private string m_sTime1 = "";
    private string m_sStuff2 = "";
    private string m_sTime2 = "";
    private string m_sStime = "";
    private string m_sEtime = "";
    private string m_sPStime = "";
    private string m_sPEtime = "";
    private string m_sBMWID = "-1";
    private string m_sBMWDID = "-1";
    private string m_sBMWSID = "-1";
    private string m_sBMWGID = "-1";
    private string m_sBMWWPID = "-1";
    private string m_sState = "-1";
    private string m_sStateName = "";
    public string f_id { get { return m_sID; } set { m_sID = value; } }
    public string f_name { get { return m_sName; } set { m_sName = value; } }
    public string f_stuff0 { get { return m_sStuff0; } set { m_sStuff0 = value; } }
    public string f_time0 { get { return m_sTime0; } set { m_sTime0 = value; } }
    public string f_stuff1 { get { return m_sStuff1; } set { m_sStuff1 = value; } }
    public string f_time1 { get { return m_sTime1; } set { m_sTime1 = value; } }
    public string f_stuff2 { get { return m_sStuff2; } set { m_sStuff2 = value; } }
    public string f_time2 { get { return m_sTime2; } set { m_sTime2 = value; } }
    public string f_parent { get { return m_sParentID; } set { m_sParentID = value; } }
    public string f_type { get { return m_sType; } set { m_sType = value; } }
    public string f_typename { get { return m_sTypeName; } set { m_sTypeName = value; } }
    public int f_percent { get { return m_sPercent; } set { m_sPercent = value; } }
    public int f_outtime { get { return m_sOutTime; } set { m_sOutTime = value; } }
    public int f_outtime0 { get { return m_sOutTime0; } set { m_sOutTime0 = value; } }
    public int f_outtime1 { get { return m_sOutTime1; } set { m_sOutTime1 = value; } }
    public int f_outtime2 { get { return m_sOutTime2; } set { m_sOutTime2 = value; } }
    public string f_count { get { return m_sCount; } set { m_sCount = value; } }
    public string f_color { get { return m_sColor; } set { m_sColor = value; } }
    public string f_brief { get { return m_sBrief; } set { m_sBrief = value; } }
    public string f_stime { get { return m_sStime; } set { m_sStime = value; } }
    public string f_etime { get { return m_sEtime; } set { m_sEtime = value; } }
    public string f_pstime { get { return m_sPStime; } set { m_sPStime = value; } }
    public string f_petime { get { return m_sPEtime; } set { m_sPEtime = value; } }
    public string f_bmwid { get { return m_sBMWID; } set { m_sBMWID = value; } }
    public string f_bmwdid { get { return m_sBMWDID; } set { m_sBMWDID = value; } }
    public string f_bmwsid { get { return m_sBMWSID; } set { m_sBMWSID = value; } }
    public string f_bmwgid { get { return m_sBMWGID; } set { m_sBMWGID = value; } }
    public string f_bmwwpid { get { return m_sBMWWPID; } set { m_sBMWWPID = value; } }
    public string f_state { get { return m_sState; } set { m_sState = value; } }
    public string f_statename { get { return m_sStateName; } set { m_sStateName = value; } }
}
#endregion
